package com.demo.domain;

import java.util.Optional;

//汽车
public class Car {
	
	//车有对应的保险公司
	private Insurance insurance;

	public Insurance getInsurance() {
		return insurance;
	}
	
	public Optional<Insurance> getInsuranceOptional() {
		return Optional.ofNullable(insurance);
	}
	
	//private Optional<Insurance> insurance;

    //public Optional<Insurance> getInsurance() {
        //return insurance;
    //}

}
